<script setup>
import rrwebPlayer from "rrweb-player";
import "rrweb-player/dist/style.css";


const replayer = ref(null);


const handleRecord = () => {
  let events = localStorage.getItem('event')
  console.log(events)
  replayer.value = new rrwebPlayer({
    target: document.getElementById("playback"), // 可以自定义 DOM 元素
    props: {
      events: events,
      speedOption: [1, 2, 5, 10],
    },
  });

}

const value = ref('')
</script>

<template>
  <div class="page_auto_warp">
    <div class="rrweb-warp">
      <div class="rrweb-title">rrweb 回放</div>

      <el-button @click="handleRecord()">播放回放</el-button>

      <div id="playback"></div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.page_auto_warp {
  color: #181818;
  overflow-y: auto;

  .rrweb-warp {
    width: 100%;
    height: 2000px;
    background-color: rgba(28, 166, 109, 0.97);
    padding: 10px;


    .rrweb-title {
      font-size: 24px;
      font-weight: bold;
      line-height: 48px;
    }

    #playback {
      margin-top: 50px;
      //width: 80%;
      //margin: 50px auto;
      //height: 500px;
      //background-color: #FFFFFF;
      //border-radius: 4px;
    }
  }
}
</style>
